// src/main.js
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia' // 引入 createPinia
import { useAuthStore } from './stores/authStore';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

const app = createApp(App)
app.use(router)
app.use(pinia) // 使用 Pinia

const authStore = useAuthStore(pinia);
authStore.init();

app.mount('#app')

// 导出 router 实例
export { router };